//
//  NSData+TDES.h
//  CLExtension
//
//  Created by CharlieLiao on 2017/8/2.
//  Copyright © 2017年 Charlie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SecurityDefine.h"


@interface NSData (TripleDES)

/// 三重DES加密 iv=nil SecurityPaddingPKCS7 SecurityModeECB
- (NSData*)encryptTDESWithKey:(NSString*)key;

/// 三重DES解密 iv=nil SecurityPaddingPKCS7 SecurityModeECB
- (NSData*)decryptTDESWithKey:(NSString*)key;

/// 三重DES加密
- (NSData*)encryptTDESWithKey:(NSString*)key andIV:(NSString *)iv padding:(SecurityPadding)padding mode:(SecurityMode)mode;

/// 三重DES解密
- (NSData*)decryptTDESWithKey:(NSString*)key andIV:(NSString *)iv padding:(SecurityPadding)padding mode:(SecurityMode)mode;


@end



@interface NSData (CLDES)

/// DES加密 iv=nil SecurityPaddingPKCS7 SecurityModeECB
- (NSData*)encryptDESWithKey:(NSString*)key;

/// DES解密 iv=nil SecurityPaddingPKCS7 SecurityModeECB
- (NSData*)decryptDESWithKey:(NSString*)key;

/// DES加密
- (NSData*)encryptDESWithKey:(NSString*)key andIV:(NSString *)iv padding:(SecurityPadding)padding mode:(SecurityMode)mode;

/// DES解密
- (NSData*)decryptDESWithKey:(NSString*)key andIV:(NSString *)iv padding:(SecurityPadding)padding mode:(SecurityMode)mode;

@end
